<template >
    <div class="demo">
        <h1> 名称:{{name}}</h1>
        <h1 ref="address">地址:{{address}}</h1>
        <button @click="showName">点击显示学校名</button>
    </div>
</template>
<script>
export default {
    name:'SchoolName',
    data() {
        return {
            name:'清华',
            address: '北京'
        }
    },
    methods: {
        showName(){
            console.log(this.$refs.address)
        }
    },
   }
</script>

<style>
/* 组件的样式 */

.demo{
    background-color: orange;
}
</style>